
var setLogin = (userdata) => {
    localStorage.setItem('rpAdminInfo', JSON.stringify(userdata))
}

var getLogin = () => {
    return JSON.parse(localStorage.getItem('rpAdminInfo')) || {}
}

var checkLogin = () => {
    let userInfo = getLogin()
    //console.log(userInfo)
    if (!userInfo.token) return false
    return true
}
var clearLogin=()=>{
    localStorage.removeItem('rpAdminInfo')
}
var setLoginPath = path => function () {
    localStorage.setItem('jumpPath', path)
}
var getLoginPath = () => {
    return localStorage.getItem('jumpPath') || "/"
}
export { setLogin, getLogin, checkLogin,clearLogin,setLoginPath,getLoginPath}